<template>
  <div id="app">
    <router-link to="/home">首页</router-link>
    <router-link to="/about">关于</router-link>
    <router-link v-bind:to="'/user/'+userId">用户</router-link>
    <router-link v-bind:to="{
                            path: '/profile',
                            query: {
                              name: 'yuhao',
                              age: 11,
                              height: 188
                              }
                            }">
                             档案
    </router-link>

    <router-link to="/home" tag="li">首页</router-link>
    <router-link to="/about" tag="button">关于</router-link>
    <keep-alive>
      <router-view></router-view>
    </keep-alive>
  </div>
</template>

<script>
export default {
  name: 'App',
  data () {
    return {
      userId: 'yuhao'
    }
  }
}
</script>

<style>
  .router-link-active {
    color: green;
  }
</style>
